package com.MedDroid.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.MedDroid.MainApp;
import com.MedDroid.R;
import com.MedDroid.task.AddNewMedicalRecordTask;

public class AddMedicalRecordActivity extends Activity
{
	public EditText EditComment;
	public int LoadedUser;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.record_comments);

		Bundle extras = getIntent().getExtras();
		if (extras != null)
		{
			LoadedUser = extras.getInt("UserID");
		}

		EditComment = (EditText) findViewById(R.id.editComments);

        Button btnAddRecord = (Button) findViewById(R.id.btnSubmitComment);
        btnAddRecord.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view)
			{
				new AddNewMedicalRecordTask(((MainApp)getApplication()).getDatabase(), AddMedicalRecordActivity.this).execute(LoadedUser);
            }
        });
    }
}